
package com.bj58.disconf.web.service.role.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.bj58.disconf.web.common.utils.DBHelper;
import com.bj58.disconf.web.service.role.bo.Role;
import com.bj58.disconf.web.service.role.service.RoleMgr;

/**
 *
 */
@Service
public class RoleMgrImpl implements RoleMgr {

    @Override
    public Role get(Integer id) {
        try {
            List<Role> ulist = DBHelper.getInstance().getDao().sql.getListByIDS(Role.class, new Object[] { id });
            return ulist != null ? ulist.get(0) : null;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public List<Role> findAll() {
        try {
            List<Role> ulist = DBHelper.getInstance().getDao().sql.getListByCustom(Role.class, "*", "", "");
            return ulist;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
